package com.test.hello.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.test.hello.basic.BasicDAO;
import com.test.hello.dao.RoleMapper;
import com.test.hello.model.Role;

@Service
public class RoleService implements BasicDAO<Role> {
	@Autowired
	private RoleMapper mapper;
	public int deleteByPrimaryKey(Long id) {
		
		return mapper.deleteByPrimaryKey(id);
	}

	public int insertSelective(Role entity) {
		
		return mapper.insertSelective(entity);
	}

	public Role selectByPrimaryKey(Long id) {
		
		return mapper.selectByPrimaryKey(id);
	}

	public int updateByPrimaryKeySelective(Role entity) {
		
		return mapper.updateByPrimaryKeySelective(entity);
	}
	/**
     * 根据角色id查询 权限以及用户
     * @param id
     * @return
     */
	public Role findById(Long id){
		return mapper.findById(id);
	}

}
